Field of the Invention
The present invention relates to a focus detection apparatus, a control method thereof, and a program, and more particularly it relates to autofocus used in electronic cameras, microscopes, and similar optical systems.
Description of the Related Art
Heretofore, there has been proposed an imaging apparatus where an imaging device, which has a great number of pixels two-dimensionally arrayed such that a relative positions of photoelectric conversions unit are deviated from microlenses and the optical axis thereof, also functions as a focus detection device. This type of focus detection is called “imaging plane phase difference”, in which phase difference focus detection is performed by focus detection pixels formed in the imaging device.
Japanese Patent Application Laid-Open No. 58-024105 discloses an imaging apparatus using a two-dimensional imaging device where one microlens, and a photoelectric conversion unit which has been divided into a plurality, are formed for one pixel. The divided photoelectric conversion unit is configured to receive different areas of an exit pupil of a photography lens via the one microlens, thereby performing pupil division. The amount of phase difference is obtained from focus detection signals received from each division of the divided photoelectric conversion units (focus detection pixels), and a defocus amount is calculated from the amount of phase difference and a conversion coefficient, from which phase difference focus detection can be performed. Japanese Patent Application Laid-Open No. 2001-083407 discloses generating imaging signals by adding received focus detection signals at a divided photoelectric conversion unit.
Also, Japanese Patent Application Laid-Open No. 2000-156823 discloses an imaging apparatus where a two-dimensional imaging device made up of multiple imaging pixels partially includes pairs of focus detection pixels. The pair of focus detection pixels are configured so as to receive different areas of the exit pupil of the photography lens, by way of a light shielding layer having openings, thus performing pupil division. Disclosed is acquiring imaging signals from imaging pixels disposed at a great portion of the two-dimensional imaging element, obtaining phase difference from focus detection signals of the partially disposed focus detection pixels, and performing phase difference focus detecting.
Now, there are cases when performing photography in which a part of the light flux traveling toward the focus detecting pixel group is blocked by the imaging optical system (including optical elements such as lenses, diaphragm, and lens barrel holding optical elements), a phenomenon known as “vignetting” occurs. Vignetting causes unevenness in intensity due to lower light quantity in at least one of a pair of generated imaging signals. This unevenness in intensity among focus detection pixels (unevenness in light reception sensitivity) will hereinafter be referred to as “shading”. Lower imaging signal level due to vignetting, and shading, may cause the level of similarity of the pair of generated imaging signals to be lower, and thus result in degraded focus detection accuracy.
Accordingly, there has conventionally been disclosed a technology to correct shading of a pair of imaging signals obtained from a pixel group receiving light fluxes which have passed through different exit pupil areas of an imaging optical system. For example, Japanese Patent Application Laid-Open No. 2008-252522 discloses a technique that stores plots of image height and distorted aberration amount at the imaging device, derives an approximation function from these values, and thereby performs correction of lateral difference in distortion, while suppressing the necessary amount of data.
Shading correction has to be performed in a highly accurate manner to realize good focus detection. However, highly accurate shading correction has a problem in that the calculation scale is large, and it takes time for the calculation processing.
Also, exchangeable lenses which have a lens aperture value at the open side and the image height of the imaging device is high, lens frame vignetting may occur due to multiple lens and diaphragm frames, so the effective aperture value changes from lens to lens. Accordingly, depending on the model of the exchangeable lens, a conversion coefficient calculated according to the reference aperture value for middle image height may be insufficient, and focus detection performance may deteriorate.
Therefore, it has been found desirable to improve calculation accuracy in calculating conversion coefficients necessary for converting a phase difference amount among focus detection signals into defocus amount, so as to improve focus detection performance. It has also been found desirable to perform highly accurate shading correction while reducing the amount of calculation processing.